package com.cxyd.modules.wms.controller;

import com.cxyd.common.page.PageData;
import com.cxyd.common.utils.Result;
import com.cxyd.modules.wms.dto.PostSapDTO;
import com.cxyd.modules.wms.service.PostSapService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("wms/post-sap")
public class PostSapController {
    private final PostSapService postSapService;

    public PostSapController(PostSapService postSapService) {
        this.postSapService = postSapService;
    }
    @GetMapping("page")
    @RequiresPermissions("wms:post-sap:page")
    public Result<PageData<PostSapDTO>> page(@RequestParam Map<String, Object> params){
        PageData<PostSapDTO> page = postSapService.page(params);

        return new Result<PageData<PostSapDTO>>().ok(page);
    }
}
